<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ include file="/parameter.jsp" %>
<%@page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<TITLE>论坛</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<Meta http-equiv="Pragma" Content="No-cach">
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
</script>
	</head>

	<body>
	<jsp:include page="inc/header.jsp" />
		<header class="entry-header">
			<h1 class="entry-title">
				<span>论坛首页<div id="searchbar">
				<form name="form3" method="post" action="commonAction.do?method=SearchTopic">
					<input type="text" id="keywords" name="keywords" title="搜索"><button onClick="search();">搜索</button>
				</form>
				</div></span>
			</h1>
		</header>
		
		<div id="maindiv">
			<div id="nav">
			<c:choose>
				<c:when test="${sessionScope.user == null}">
					<div>
						<form name="form1" method="post" action="commonAction.do?method=UserLogin">
						账号：<input type="text" name="username"> 密码：<input type="password" name="password"> 
						<button onClick="loginsubmit();">登陆</button> <a href="commonAction.do?method=toRegister">注册新账号</a>
						</form>
					</div>
				</c:when>
				<c:otherwise>
					<div>
					&nbsp;&nbsp;<c:choose><c:when test="${sessionScope.user.nickname != ''}">${sessionScope.user.nickname}</c:when><c:otherwise>${sessionScope.user.username}</c:otherwise></c:choose>&nbsp;你好！<a
							href="commonAction.do?method=Logout">注销</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserInfo&uid=${sessionScope.user.id}">修改个人信息</a>&nbsp;|&nbsp;<a
							href="commonAction.do?method=EditUserPwd&uid=${sessionScope.user.id}">修改密码</a>
					</div>
				</c:otherwise>
			</c:choose>
				<a href="./" title="首页">首页</a>
				<span>&gt;</span>
                板块管理
			</div>
			<c:if test="${sessionScope.user.usergrade == '0'}">
			<div class="mngbar"><a href="commonAction.do?method=UserManagerPer">用户管理</a> | <a href="commonAction.do?method=SortPer">板块分类管理</a> | <a href="commonAction.do?method=BoardPer">板块管理</a> | <a href="commonAction.do?method=RecordPer">操作记录</a></div>
			</c:if>
			<div id="board">
				<div class="bm">
					<div class="bm_h">
						<h2>板块分类管理</h2>
					</div>
					<div class="bm_b">
						<table cellspacing="0" cellpadding="0" class="tblList">
							<tr>
								<th>父级分类名称</th>
								<th>分类名称</th>
								<th>是否在首页显示</th>
								<th>版主</th>
								<th>操 作</th>
							</tr>
		<c:forEach items="${boardlist}" var="board" varStatus="status">
        	<c:forEach items="${board.selfboard}" var="subboard" >
							<tr>
								<td>${board.boardname}</td>
								<td>${subboard.boardname}</td>
								<td><c:if test="${subboard.isdisplay == '0'}">是</c:if><c:if test="${subboard.isdisplay == '1'}">否</c:if></td>
								<td>${subboard.boarduser.nickname}</td>
								<td>
									<a href="commonAction.do?method=BoardModifyPre&id=${subboard.id}">[编辑]</a>
									<a href="commonAction.do?method=BoardDeleteDao&id=${subboard.id}" onClick="return checkDelete();">[删除]</a>
								</td>
							</tr>
            </c:forEach>
		</c:forEach>

						</table>
						<div class="pg">
						</div>
					</div>
					<button onClick="document.location='commonAction.do?method=BoardAddPre'">添加新板块</button>
				</div>
			</div>
		</div>
	<jsp:include page="inc/footer.jsp" />
	</body>
</html>
